<?php defined("MAIN_DIR") or die("No direct access");

$query = "select `V`.* from `vacancy` as `V`,`bank` as `B`
	where `V`.`bank_id` = `B`.`bank_id` and `B`.`city_id` = '$_SESSION[city]'
	order by `vacancy_id` desc limit 4";
$new_vacancies = $db->getTable($query);

if ($new_vacancies) {
	
	?><div id="vac_heading"><a href="<?php echo "/$c_name";?>/banks/vacancies">Вакансии банков</a></div>
	<div id="vac_items"><?php
		foreach ($new_vacancies as $vacancy_row) {
			?><div class="vac_item">
				<a href="<?php echo "/$c_name";?>/banks/vacancies/<?php echo $vacancy_row['vacancy_id']; ?>"><?php echo $vacancy_row['title'];?></a>
			</div>
			<div class="vac_salary"><?php
				echo $vacancy_row['salary'] != 0 ? "от ".get_salary($vacancy_row['salary'])." руб." : "по договоренности";
			?></div><?php
		}
	?></div><?php
}
